<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="style/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="style/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="style/js/fun.js"></script><title></title></head><body><span class="subTitle">[一维数组] 第一种方法, 同时给数组所有元素赋值</span>
<?php	$str_1 = array("string1_1","string1_2","string1_3","string1_4");	for($i = 0; $i < count($str_1); $i++){		echo $str_1[$i];		echo "<br />";	}?>
<span class="subTitle">[一维数组] 第二种方法, 单独给数组赋值</span>
<?php
	$str_2[0] = "string2_1";
	$str_2[1] = "string2_2";
	$str_2[2] = "string2_3";
	$str_2[3] = "string2_4";
	$str_2[4] = "string2_5";
	
	for($i = 0; $i < count($str_2); $i++){
		echo $str_2[$i];
		echo "<br />";
	}
?>
<span class="subTitle">[多维数组] 同时给数组所有元素赋值</span>
<?php
	$str_3 = array(0 => array("string3_1","string3_2"),1 => array("string3_3","string3_4"));
	for($i = 0; $i < count($str_3); $i++){
		for($j = 0; $j < count($str_3[$i]); $j++){
			echo $str_3[$i][$j];
			echo "<br />";
		}
	}
?>
<span class="subTitle">[多维数组] 单独给数组赋值</span>
<?php
	$str_4[0][0] = "string4_1";
	$str_4[0][1] = "string4_2";
	$str_4[0][2] = "string4_3";
	$str_4[0][3] = "string4_4";
	$str_4[1][0] = "string4_5";
	$str_4[1][1] = "string4_6";
	for($i = 0; $i < count($str_4); $i++){
		for($j = 0; $j < count($str_4[$i]); $j++){
			echo $str_4[$i][$j];
			echo "<br />";
		}
	}
?></body></html>